﻿#include <stdio.h>
int main()
{
	char buf[31] = { 0 };
	scanf("%[^\n]s", buf);
	
	int i = 0;
	while (buf[i])
	{
		if (buf[i] >= 'a' && buf[i] <= 'z')
			buf[i] -= 32;
		else if (buf[i] >= 'A' && buf[i] <= 'Z')
			buf[i] += 32;
		i++;
	}
	printf("%s\n", buf);
	return 0;
} 
//⽅法2：使⽤库函数
#include <stdio.h>
#include <ctype.h>
int main()
{
	char buf[31] = { 0 };
	scanf("%[^\n]s", buf);
	int i = 0;
	while (buf[i])
	{
		if (islower(buf[i]))
			buf[i] = toupper(buf[i]);
		else if (isupper(buf[i]))
			buf[i] = tolower(buf[i]);
		i++;
	}
	printf("%s\n", buf);
	return 0;
}